package routes

import (
	"cashcenter/internal/handler"
	"github.com/gin-gonic/gin"
)

func InitRouter(ginRouter *gin.Engine) {
	cashcenterV1 := ginRouter.Group("/cashcenter/v1")
	{
		// 支付宝异步通信
		cashcenterV1Nil := cashcenterV1.Group("/nil")
		{
			AlipayNil := cashcenterV1Nil.Group("/alipay")
			{
				AlipayNil.GET("/paypage", handler.AlipayPage)
				AlipayNil.POST("/notify", handler.AlipayNotify)
				AlipayNil.GET("/return", handler.AlipayReturn)
				AlipayNil.GET("/state", handler.AlipayState)
			}
		}

		cashcenterV1Def := cashcenterV1.Group("/def")
		{
			cashcenterV1Def.POST("/cashin", handler.CashIn)
			cashcenterV1Def.POST("/cashout", handler.CashOut)
			cashcenterV1Def.GET("/balance", handler.Balance)
			cashcenterV1Def.GET("/account", handler.Account)
		}

		cashcenterV1Sys := cashcenterV1.Group("/sys")
		{
			cashcenterV1Sys.GET("/co-list", handler.CoList)
			cashcenterV1Sys.POST("/co-audit", handler.CoAudit)
		}
	}

}
